package com.lyn.solitude_plugin_host.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;
import com.lyn.solitude_plugin_host.binder.PluginHostBinder;

/**
 * 插件服务
 * @author longyn 2024/4/20
 * @version 1.0.0
 */
public class PluginService extends Service {

    private final static String TAG = "PluginService";

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.d(TAG,"onBind");
        return  PluginHostBinder.getInstance();
    }


    @Override
    public void onCreate() {
        super.onCreate();
        Log.d(TAG,"onCreate");
        PluginHostBinder.getInstance().initialize(getApplication());

    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(TAG,"onStartCommand");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d(TAG,"onDestroy");
    }
}
